<extend name="Public:base" />

<block name="content">

    <form action="{:U('InvoiceManage/index')}" method="post">
        <div class="table-responsive">
            <table class="table table-striped table-bordered table-hover search-form">
                <thead>
                <tr>
                    <th>
                        <input class="marginL10" name="number" type="text" value="{:I('order_id')}"  placeholder="发票申请编号" value="{:I('order_id')}" />
                        <input class="marginL10" name="name" type="text" value="{:I('order_id')}"  placeholder="用户姓名" value="{:I('order_id')}" />
                        <input class="marginL10" name="phone" type="text" value="{:I('order_id')}"  placeholder="用户电话" value="{:I('order_id')}" />
                        <input class="btn btn-primary radius5 btn-sm" type="submit" value="查询"/>
                        <!--  <a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Member/index')}">搜索</a>-->
                    </th>
                </tr>
                </thead>
            </table>
        </div>
    </form>
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover" id="mytable">

            <thead>
            <tr>
                <th>发票申请编号</th>
                <th>发票抬头</th>
                <th>发票金额（元）</th>
                <th>税率费（元）</th>
                <th>快递费支付方式</th>
                <th>邮寄信息</th>
                <th>申请时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="ba" key="k">
                <tr>
                    <td><a href="{:U('Invoice/detail&id=').$ba['number']}">{$ba['number']}</a></td>
                    <td>{$ba['name']}</td>
                    <td>{$ba['money']}</td>
                    <td>{$ba['tax']}</td>
                    <td>{$ba['method']}</td>
                    <td>{$ba['contacts_name']}{$ba['contacts_phone']}{$ba['address']}{$ba['email']}</td>
                    <td>{$ba['add_time']|date="Y-m-d H:i:s",###}</td>
                    <td>{$ba['status']==0?'待开发票':'已开发票'}</td>
                    <td><input class="btn btn-info radius5 btn-xs
                    ticket"  type="button" value="已开票" onclick="op({$ba['id']})"></td>
                </tr>
            </volist>
            <tr>
                <td colspan="20" class="page">{$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</block>
<block name="css">
</block>
<block name="javascript">
<script>
    $(function(){
        $(".ticket").click(function(){
            sessionStorage.setItem("text","已开发票");
        });
    });

    function op(id){
        $.ajax({
            type:'post',
            url:"{:U('InvoiceManage/op')}",
            data:{
              id:id
            },
            success:function(){
                window.location="{:U('InvoiceManage/invoice')}"

            }
        })
    }
</script>

</block>